def main():
    i = 1
    while i == 1:
        print('请输入操作项：')
        n = input('1：执行程序\n2：退出程序\n')

        if n == '1':
            print('请输入以下信息：')
            sex = input('性别：')
            weight = float(input('体重(Kg)：'))
            high = float(input('身高(cm)：'))
            age = int(input('年龄：'))
            if sex == '男':
                bmr = (13.7 * weight) + (5.0 * high) - (6.8 * age) + 66
            elif sex == '女':
                bmr = (9.6 * weight) + (1.8 * high) - (4.7 * age) + 655
            else:
                bmr = -1
            if bmr == -1:
                print('暂不支持该性别')
            else:
                print('基础代谢率为：', bmr)
                print('====================')
        elif n == '2':
            i = 0
            print('程序已退出！')
        else:
            print('你输入的选项有误，请重新输入')
            print('============================')


if __name__ == '__main__':
    main()
